<%@page import="cn.sendto.dbhelper.DBHelper"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
  //
  
  request.setCharacterEncoding("UTF-8");
  //取得请求页面的班级ID
  String id = request.getParameter("classid");
  //取得请求页面的班级名称
  String classname = request.getParameter("classname");
  
  //实例化操作数据库的类DBHelper
  DBHelper helper = new DBHelper();
  
  //定义SQL语句
  String sql = "update classinfo set classname= ? where classid = ?";
  
  //返回执行影响行数
  int rows = helper.executeSQL(sql, classname,id);
  
  if(rows>0)
  {
	  request.getRequestDispatcher("class_list.jsp").forward(request, response);
  }
  else
  {
	  request.setAttribute("info", "对不起，修改失败,请与管理员联系！");
	  request.getRequestDispatcher("modfiyClass.jsp").forward(request, response);
  }
%>